package top.hiai.service;

import com.jfinal.plugin.activerecord.Page;

import top.hiai.model.UserXia;

/**
* @Author www.hiai.top
* @Email  goodsking@163.com
* @Message 更多资源尽在www.hiai.top,开发者：黄康权
* @Introduction 类的介绍
*/

public class UserXiaService {
	
	private UserXia dao = new UserXia().dao();
	
	/**
	 * 根据用户登录的ID遍历该用户已经下载的文章资源
	 * @param pageNumber
	 * @param pageSize
	 * @return
	 */
	public Page<UserXia> paginateGetUserXia(int pageNumber, int pageSize,int uid) {
		return dao.paginate(pageNumber, pageSize, "select t_article.aid,t_article.name,t_userxia.xid ,t_userxia.download_date ", " "
				+ "from t_userxia ,t_article "
				+ "where t_article.aid=t_userxia.article_id and t_userxia.user_id = '"+uid+"' order by t_userxia.download_date DESC");
	}
}
